Hosting Ghost
A short guide to running Ghost in a production environment and setting up an independent publication to serve traffic at scale.
Ghost is open source software, and can be installed and maintained relatively easily on just about any VPS hosting provider. Additionally, we run an official PaaS for Ghost called Ghost(Pro), where you can have a fully managed instance set up in a couple of clicks. All revenue from Ghost(Pro) goes toward funding the future development of Ghost itself, so by using our official hosting youβll also be funding developers to continue to improve the core product for you.
Ghost(Pro) vs Self-hostingβ
A common question we get from developers is whether they should use our official platform, or host the codebase on their own server independently. Deciding which option is best for you comes with some nuance, so below is a breakdown of the differences to help you decide what will fit your needs best.
Ghost(Pro) | Self-Hosting | |
---|---|---|
π Product features | Identical | Identical |
βοΈ Base hosting cost | From $9/mo | From $10/mo |
π Worldwide Fastly CDN | Included | From $50/mo |
π Email newsletter sending | Included | From $35/mo |
π¦ Full site backups | Included | From $5/mo |
πΌοΈ Built-in image editor | Included | From $12/mo |
π΅ Payment processing fees | 0% | 0% |
π₯ Install & setup | β | Manual |
π Weekly updates | β | Manual |
π§ Server maintenance & updates | β | Manual |
π SSL Certificate | β | Manual |
β οΈ Threat & uptime management | β | β |
π₯ Enterprise-grade security | β | β |
π Custom edge routing policies | β | β |
π©βπ» Direct SSH & DB access | β | β |
π¨ Ability to modify core | β | β |
π Ghost product support | Forum | |
β€οΈ Where your money goes | New features in Ghost | 3rd party companies |
Which option is best for me?β
Self-hosting is the best choice for teams who are comfortable managing servers, databases and Node.js apps who want full control over their environment. Thereβs more complexity involved, and you have to signup-for and pay for your own Mailgun account (email delivery) and CDN service (performance and scale) β but ultimately more flexibility around exactly how the software runs. For people sending lots of email newsletters, self-hosting generally works out to be more expensive compared to Ghost(Pro), but for people who arenβt using email functionality, it can work out to roughly the same price.
See self-hosting guides & instructions β
Ghost(Pro) is the best choice for most people who are focused on using the Ghost software, and donβt want to spend time managing servers. Setting up a new Ghost site takes around 20 seconds, and after that all weekly updates, backups, security and performance are managed for you. If your site ever goes down, our team gets woken up while you sleep peacefully. In most cases Ghost(Pro) ends up being lower cost than self-hosting once you add up the cost of the different service providers.
See Ghost(Pro) pricing & plans β
TLDR: If you want the easiest, cheapest option: Ghost(Pro) is probably your best bet. If you have a technical team and you want maximum control and flexibility, youβll get more out of self-hosting.
Self-hosting details & configurationβ
Ghost has a small team, so we optimize the software for a single, narrow, well defined stack which is heavily tested. This is the same stack that we use on Ghost(Pro), so we can generally guarantee that itβs going to work well. Ghost can also run successfully with different operating systems, databases and web servers, but these are not officially supported or widely adopted, so your mileage may (will) vary.
Our officially supported and recommended stack is as follows:
- Ubuntu 16.04, 18.04, 20.04 or 22.04
- MySQL 8.0
- NGINX
- Systemd
- Recommended Node version installed via NodeSource
- A server with at least 1GB memory
- A non-root user for running
ghost
commands
See self-hosting guides & instructions β
Server hardeningβ
After setting up a fresh Ubuntu install in production, itβs worth considering the following steps to make your new environment extra secure and resilient:
- Use SSL - Ghost should be configured to run over HTTPS. Ghost admin must be run over HTTPS. You can choose to load admin on a separate domain for additional security
- Secure MySQL - We strongly recommend running
mysql_secure_installation
after successful setup to significantly improve the security of your database. - Set up a firewall - Ubuntu 18.04, 20.04 and 22.04 servers can use the UFW firewall to make sure only connections to certain services are allowed. We recommend setting up UFW rules for
ssh
,nginx
,http
, andhttps
. If you do use UFW, make sure you donβt use any other firewalls. - Disable SSH Root & password logins - Itβs a very good idea to disable SSH password based login and only connect to your server via proper SSH keys. Itβs also a good idea to disable the root user.
- Separate admin domain - Configuring a separate admin URL can help to guard against privilege escalation and reduces available attack vectors.
Optimizing for scaleβ
The correct way to scale Ghost is by adding a CDN and/or caching layer in front of your Ghost instance. Clustering or sharding is not supported in any way. Every day 2-5 of the top stories on Hacker News are published with Ghost, and to the best of our knowledge no Ghost site has ever fallen over as a result of a traffic spike. Minimal, sensible caching is more than enough.
Staying up to dateβ
Whenever running a public-facing production web server itβs critically important to keep all software up to date. If you donβt keep everything up to date, you place your site and your server at risk of numerous potential exploits and hacks.
If you canβt manage these things yourself, ensure that a systems administrator on your team is able to keep everything updated on your behalf.